//
//  HYDownLoadTableViewCell.m
//  MusicMV
//
//  Created by Eternity on 16/3/24.
//  Copyright © 2016年 Eternity. All rights reserved.
//

#import "HYDownLoadTableViewCell.h"

@interface HYDownLoadTableViewCell ()

@property (nonatomic , strong) UIImageView *MVimage;
@property (nonatomic , strong) UILabel *titleLabel;


@end


@implementation HYDownLoadTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self create];
    }
    return self;
}

- (void)create {
    
    self.MVimage = [[UIImageView alloc] init];
    [self.contentView addSubview:_MVimage];
    self.titleLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_titleLabel];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    _MVimage.frame = CGRectMake(0, 0, SCREEN_WIDTH / 2.5, self.contentView.frame.size.height);
    _titleLabel.frame = CGRectMake(SCREEN_WIDTH / 2.5 + 10 * wt, 15 * wt, SCREEN_WIDTH / 2, 50 * ht);
    _titleLabel.numberOfLines = 0;
    _titleLabel.textColor = [UIColor blackColor];
    _titleLabel.backgroundColor = [UIColor clearColor];
    _titleLabel.font = [UIFont systemFontOfSize:16];
}


- (void)setDownModel:(HYDownLoadModel *)downModel {
    _downModel = downModel;
    [_MVimage sd_setImageWithURL:[NSURL URLWithString:_downModel.photo]];
    _titleLabel.text = _downModel.title;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
